<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="__MODES__/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link href="__MODES__/assets/css/codemirror.css" rel="stylesheet">
		<link rel="stylesheet" href="__MODES__/assets/css/ace.min.css" />
		<link rel="stylesheet" href="__MODES__/assets/css/font-awesome.min.css" />
		<script src="__MODES__/assets/js/jquery.min.js"></script>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='__MODES__/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
		</script>
		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='__MODES__/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script>
		<script src="__MODES__/assets/js/bootstrap.min.js"></script>
		<script src="__MODES__/assets/js/typeahead-bs2.min.js"></script>
		<script type="text/javascript" src="__JS__/H-ui.js"></script>
		<script type="text/javascript" src="__JS__/H-ui.admin.js"></script>
		
		<script  src="__PLUGINS__/layer/layer.js"></script>
	    <script  src="__PLUGINS__/common.js"></script>
		<title>赠送记录</title>
	</head>
	<body>
		<div class="page-content clearfix">
			<div id="Member_Ratings">
				<div class="d_Confirm_Order_style">
					<form method="post" action="">
						<div class="search_style">
							<ul class="search_content clearfix">
								<!-- <li><label class="l_f">优惠券名称</label>
									<select name="keywords" id="keywords" style=" width:200px;margin-left:5px">
										<option value="">请选择</option>
										<option value="1">商城积分券</option>
										<option value="2">升级等级券</option>
										<option value="3">计划优惠券</option>
										<option value="4">收款优惠券</option>
									</select>
								</li> -->
								<li><label class="l_f">会员</label>
									<input type="text" placeholder="请输入会员账号" name="keywords" id="keywords1" style=" width:200px;margin-left:5px" />
								</li>
								<li style="width:90px;"><input type="submit" id="search" class="btn_search" value="查询"></li>
								<li style="width:90px;"><button type="button" id="searchAout" class="btn_search"><i class="icon-search"></i>全部</button></li>
							</ul>
						</div>
					</form>
					<!---->
					<div class="table_menu_list">
						<table class="table table-striped table-bordered table-hover" >
							<thead>
								<tr>
									<th width="25"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
									<th width="20">ID</th>
									<th width="100">优惠券名称</th>
									<th width="100">会员</th>
									<th width="100">领取时间</th>
									<th width="100">领取说明</th>
									<th width="100">优惠券金额</th>
									<th width="150">优惠券类型</th>
									<th width="150">过期时间</th>
									<th width="100">赠送来源</th>
									<th width="100">优惠券时间</th>
									<th width="100">使用时间</th>
									<th width="100">使用说明</th>
									<th width="100">操作</th>
								</tr>
							</thead>
							<tbody>
								{volist name='list' id='v' }
									<tr>
										<td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
										<td>{$v.coul_id}</td>
										<td>{$v.coul_cou}</td>
										<td>{$v.coul_user|getUser='user_account'}</td>
										<td>{$v.coul_receive_time|date='Y-m-d H:i:s'}</td>
										<td>{$v.coul_receive_test}</td>
										<td>{$v.coul_money}</td>
										<td>
											{switch v.coul_type}
											    {case 1}商城积分券{/case}
											    {case 2}升级等级券{/case}
											    {case 3}计划优惠券{/case}
											    {case 4}收款优惠券{/case}
											{/switch}
										</td>
										<td>
											{if $v['coul_time'] == 0 }
												长期有效
	                                    	{else /}
	                                    		{$v.coul_time}天
	                                    	{/if}
	                                    </td>
										<td>
											{switch v.coul_rule}
											    {case 0}注册{/case}
											    {case 1}分享{/case}
											    {case 2}推广{/case}
											    {case 3}推广升级{/case}
											{/switch}
										</td>
										<td>
											
										</td>
										<td>
											{if $v.coul_use_time}
												{$v.coul_use_time|date='Y-m-d H:i:s'}
											{else}
												未使用
											{/if}
										</td>
										<td>{$v.coul_use_test}</td>
										<td>
											{if $v.coul_state==0}
												<a href="javascript:void(0);" class="link-confirm btn btn-xs btn-danger" data-url="/Admin/Coupon/coudels.html?id={$v.coul_id}" data-confirm="您确定要删除吗？">删除</a>
											{elseif $v.coul_state==2}
												<a href="javascript:void(0);" class="link-confirm btn btn-xs btn-danger" data-url="/Admin/Coupon/coudels.html?id={$v.coul_id}" data-confirm="您确定要删除吗？">删除</a>
											{/if}
										</td>
									</tr>
								{/volist}
							</tbody>
						</table>
					</div>
					<div>
                        {//$list|raw}
		            </div>
				</div>
			</div>
		</div>
		<!--添加用户图层-->
		
	</body>

</html>
<script>
	jQuery(function($) {
		
		// $('#search').on('click', function() {
		// 	var text = $('#keywords').val();
		// 	// alert(text);
		// 	if(text==''){
		// 		layer.msg('请输入搜索关键词');
		// 		return false;
		// 	}
		// 	// window.location.href = "{:Url('Admin/Coupon/usedcoulist')}?keywords="+text; 
		// });
		
		$('#searchAout').on('click', function() {
			window.location.href = "{:Url('Admin/Coupon/usedcoulist')}"; 
		});
		
		$('table th input:checkbox').on('click', function() {
			var that = this;
			$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function() {
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});

		});

	});


</script>